<?php

namespace App\Http\Controllers\Home;

use Illuminate\Http\Request;
use DB;
use App\Http\Requests;
use App\Http\Controllers\Controller;

class OrderController extends Controller
{
	//显示前台订单页面
	public function order(){
		 $orders = DB::table('order')->paginate(5);
		return view('home.personal.order',['orders'=>$orders]);
	}
	
	//更新订单方法
	public function modify(Request $request){
		//获取订单id
		$oid=$request->input('oid');
		//查找订单信息
		$order=DB::table('order')->where('oid','=',$oid)->first();
		//json编码后返回
		return response()->json($order);
		
	}
	
	
	
	
	
}
